package Ex5th;

public class Human {
    protected String name;
    protected int age;
    /*
     性别代码，其中：
     0 保密 | 1 男性 | 2 女性 | 其他 未知
    */
    protected int gender;
    protected String school;

    protected Human(String name, int age, int gender, String school){
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.school = school;
    }

	/*
	 自我介绍
	*/
    public void intro(){
        System.out.println("---------------这是自我介绍---------------");
        System.out.println("\t姓名：" + name);
        System.out.print("\t年龄：");
        System.out.print(age);
        System.out.print("\n");
        System.out.print("\t性别：");
        switch (gender) {
            case 0:
                System.out.print("保密");
                break;
            case 1:
                System.out.print("男性");
                break;
            case 2:
                System.out.print("女性");
                break;
            default:
                System.out.print("未知");
                break;
        }
        System.out.print("\n");
        System.out.println("\t学校：" + school);
    }
}
